<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<HTML>
	<HEAD>
		<TITLE>编辑通讯录</TITLE>
		<LINK href="./jsp/manage/css/style.css" type=text/css rel=stylesheet>
		<script language="javascript" src="./jsp/manage/js/changedate.js"></script>
	</HEAD>

	<script type="text/javascript">
	function CheckForm(){
		var str=document.myform.name.value.replace(/\s+/g, '');
		if (str==''){
		   alert('姓名不能为空！');
		   document.myform.name.focus();
		   return false;
		}
		str=document.myform.email.value.replace(/\s+/g, '');
		if (str==''){
		   alert('EMail不能为空！');
		   document.myform.email.focus();
		   return false;
		}else{
		    if(document.myform.email.value.indexOf("@")==-1||document.myform.email.value.indexOf(".")==-1)
		    {
		       window.alert("请输入正确的E-mail地址！")
		       document.myform.email.focus();
		       return false;
		    }
		 }
		return true;  
	}
	</script>

	<BODY topMargin=0 marginheight="0" marginwidth="0">

		<FORM name="myform" onsubmit="return CheckForm();" method="post" target="_self" 
			action="<%=request.getContextPath()%>/libAddrManage.do?method=libaddreditsave">
			<TABLE class=border cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
				<TBODY>
					<TR class=topbg>
						<TD height=22 colSpan=2 align=middle></TD>
					</TR>
					<TR align=middle>
						<TD>
							<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
								<TBODY>
									<TR class=tdbg>
										<TD align=right width=7%>
											&nbsp;
										</TD>
										<TD colspan="10">
											<FONT color=#ff0000>
											<STRONG>注意<font color="#0000ff">*的内容必须填</font> </STRONG> 
											</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=7%>
											<STRONG>姓名：</STRONG>
										</TD>
										<TD colspan="10">
											<input id="name" maxlength=255 size=50 name="name" value="${libaddr.name}">
											<input name="libaddrID" type="hidden" value="${libaddr.libaddrID}">
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align="right" width="9%">
											<STRONG>职位：</STRONG>
										</TD>
										<TD colspan="10">
											<input id="position" maxlength=255 size=50 name="position" value="${libaddr.position}">
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align="right" width="9%">
											<STRONG>电话：</STRONG>
										</TD>
										<TD colspan="10">
											<input id="tel" maxlength=255 size=50 name="tel" value="${libaddr.tel}">
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align="right" width="9%">
											<STRONG>E-Mail：</STRONG>
										</TD>
										<TD colspan="10">
											<input id="email" maxlength=255 size=50 name="email" value="${libaddr.email}"><FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align="right" width="7%">
											<STRONG>校区：</STRONG>
										</TD>
										<TD colspan="10">
											<div align="left">
												<select name="area">
													<option value="${libaddr.area}" selected>
														${libaddr.area}
													</option>
													<option value="东校区">
														东校区
													</option>
													<option value="西校区">
														西校区
													</option>
												</select>
											</div>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align="right" width="7%">
											<STRONG>部门：</STRONG>
										</TD>
										<TD colspan="10">
											<div align="left">
												<font color=blue> <select name="department">
														<option value="${department.sortMapId}" selected>
															${department.value}
														</option>
														<logic:iterate id="w" name="departnamelist"
															indexId="count">
															<option value="${w[0]}">
																${w[1]}
															</option>
														</logic:iterate>
													</select>
												</font>
											</div>
										</TD>
									</TR>
									<TR class=tdbg id=ArticleContent>
										<TD align="right" width="7%">
											<STRONG>备注：</STRONG>
										</TD>
										<TD colspan="10">
											<textarea id="libaddrcontent" name="libaddrcontent" rows="20"
												cols="100" style="width:60%">${libaddr.memo}
											</textarea>
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</TD>
					</TR>
					<tr align="center">
						<td colspan="2">
							<INPUT id="Save" style="CURSOR: hand" type="submit" value="添加" name="Save">
							<INPUT id="Cancel" style="CURSOR: hand" type="reset" value="取消" name="Cancel" 
								onclick="window.location.reload('<%=request.getContextPath()%>/libAddrManage.do?method=libaddrlist') " >
						</td>
					</tr>
				</TBODY>
			</TABLE>
			<BR>
		</FORM>

	</BODY>
</HTML>
